package com.zp.collection;

import java.util.LinkedList;

public class LinkedListTest {
	public static void main(String[] args) {
		
		LinkedList<String> linkedlist = new LinkedList<String>();
		
		linkedlist.add("C");
		linkedlist.add("D");
		
		linkedlist.addFirst("A");
		linkedlist.addLast("E");
		
		linkedlist.add(1,"B");
		
		for(int i=0;i<linkedlist.size();i++){
			System.out.println(linkedlist.get(i));
		}
		
		System.out.println("====================");
		
		linkedlist.remove("B");
		linkedlist.remove(2);
		
		for(int i=0;i<linkedlist.size();i++){
			System.out.println(linkedlist.get(i));
		}
		
		System.out.println("===================");
		
		linkedlist.set(0,"Achanged");
		
		for(int i=0;i<linkedlist.size();i++){
			System.out.println(linkedlist.get(i));
		}
	}
}
